import sys
import os
List = sys.argv
len = len(List)
if len>1:
    parms = List[1]
    path = sys.path[0]
    # print(parms)
    filelist = [x for x in os.listdir(path) if parms in x]
    print(filelist)
    for f in filelist:
        filetype = f.split(".")[-1]
        file_write = os.path.join(path,"config."+filetype)
        file_read = os.path.join(path,f)
        print(file_write)
        print(file_read)
        with open(file_write,"w",encoding="utf-8") as fw:
            with open(file_read,"r",encoding="utf-8") as fr:
                for l in fr.readlines():
                    fw.write(l)
else:
    print("请输入参数")